home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / A-Monthly Disks / (c)aai.d64 / screen master (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  7KB  |  249 lines

  1. 50002 REM **********************
  2. 50004 REM *   SCREEN MASTER    *
  3. 50006 REM *                    *
  4. 50008 REM * BY HOWARD CAMPBELL *
  5. 50009 REM **********************
  6. 50010 :
  7. 50012 DIMSC%(1000),CL%(1000)
  8. 50015 GOSUB52730
  9. 50020 GOSUB 59000
  10. 50030 GOSUB 59100
  11. 50040 GOTO 50020
  12. 50070 :
  13. 51000 REM *************************
  14. 51001 REM * DEC TO HEX CONVERSION *
  15. 51002 REM *************************
  16. 51003 :
  17. 51010 MSB=INT(L/256):LSB=L-MSB*256
  18. 51020 POKE251,LSB:POKE252,MSB
  19. 51030 RETURN
  20. 51035 :
  21. 51040 REM *************************
  22. 51041 REM * HEX TO DEC CONVERSION *
  23. 51042 REM *************************
  24. 51043 :
  25. 51050 L=PEEK(251)+PEEK(252)*256
  26. 51060 RETURN
  27. 51070 :
  28. 52000 REM ****************
  29. 52001 REM * INSTRUCTIONS *
  30. 52002 REM ****************
  31. 52003 :
  32. 52010 PRINT"[147]CONSTRUCT YOUR TITLE PAGE AS DESIRED."
  33. 52020 PRINT"TYPE IT COMPLETE WITH COLORS, REVERSED  CHARACTERS, ETC.."
  34. 52030 PRINT"TO ADD TO YOUR CONVIENIENCE, ALL KEYS   WILL REPEAT."
  35. 52035 PRINT"THE CURSOR CAN'T BE MOVED TO THE EXTREMELOWER RIGHT CORNER."
  36. 52040 PRINT"WHEN THE SCREEN IS COMPLETED, PRESS [155]F1[146]."
  37. 52045 PRINT"PRESS [155]F7[146] TO LOWER THE SCREEN AND [155]F8[146] TO  RAISE IT"
  38. 52050 PRINT""SPC(7)"PRESS [155]<SPACE>[146] TO CONTINUE"
  39. 52060 A$="":GETA$:IFA$=""THEN52060
  40. 52065 PRINT"[147]";
  41. 52070 RETURN
  42. 52080 :
  43. 52100 REM **************
  44. 52101 REM * ENTRY MODE *
  45. 52102 REM **************
  46. 52103 :
  47. 52110 POKE650,128
  48. 52120 PRINT"[147]PRESS [155]<SPACE>[146] TO SELECT THE SCREEN COLOR"
  49. 52125 PRINT"WHEN YOU OBTAIN THE SCREEN YOU WANT,    PRESS [155]<RETURN>[156]":A=1
  50. 52130 GETA$:IFA$=" "THENA=A+1+16*(A>15):POKE53281,A:GOTO52130
  51. 52135 IFA$<>CHR$(13)THEN52130
  52. 52138 PRINT"[147]";
  53. 52140 POKE204,0:POKE205,20
  54. 52150 GETA$:IFA$=""THEN52150
  55. 52155 IFA$="[136]"THENGOSUB59200
  56. 52156 IFA$="[140]"THENGOSUB59300
  57. 52158 IFA$="[133]"THENWAIT207,1,1:POKE204,1:RETURN
  58. 52160 IFPEEK(214)=24THENIFPEEK(211)=39ORA$=""THENA$="[157]"
  59. 52165 POKE205,2
  60. 52170 WAIT207,1,1:PRINTA$;:GOTO52140
  61. 52180 :
  62. 52200 REM *********************
  63. 52201 REM * STORE SCREEN DATA *
  64. 52202 REM *********************
  65. 52203 :
  66. 52210 CO=54272:POKE253,PEEK(53281)AND15
  67. 52220 FORI=1024TO2023
  68. 52230 SC%(I-1023)=PEEK(I):CL%(I-1023)=PEEK(I+CO)AND15:POKEI,102:POKEI+CO,7
  69. 52240 NEXT:PRINT"[147]":POKE53281,12:POKE646,6:RETURN
  70. 52250 :
  71. 52300 REM *********************
  72. 52301 REM * LINE NUMBER ENTRY *
  73. 52302 REM *********************
  74. 52303 :
  75. 52310 PRINT"[147]ENTER STARTING LINE NUMBER FOR YOUR"
  76. 52320 PRINT"SCREEN DATA STATEMENTS.":INPUTL:IFL>64000THEN52310
  77. 52330 GOSUB51000
  78. 52340 RETURN
  79. 52350 :
  80. 52400 REM******************************
  81. 52401 REM* PRINT STATEMENT PRODUCTION *
  82. 52402 REM******************************
  83. 52403 :
  84. 52405 P=1:BF=0
  85. 52406 PRINT"[147]ENTER THE NAME OF THE BASIC PROGRAM":INPUTNM$
  86. 52407 OPEN15,8,15,"I0":CLOSE15:OPEN2,8,2,"@0:"+NM$+",P,W"
  87. 52408 PRINT#2,CHR$(1);CHR$(8);
  88. 52409 PRINT"[147]MAKING BASIC PROGRAM":OPEN3,3
  89. 52410 SC=1028:GOSUB51040
  90. 52420 IFP=1001THENPRINT#2,CHR$(0);CHR$(0);CHR$(0);:CLOSE2:CLOSE3:RETURN
  91. 52422 PRINT#2,CHR$(1);CHR$(8);CHR$(PEEK(251));CHR$(PEEK(252));CHR$(153);CHR$(34);
  92. 52460 SC=SC+1:CH=SC
  93. 52470 POKE254,PEEK(53281):POKE828,0
  94. 52480 PB=SC%(P):PK=CL%(P):BF=(BF+1)AND15:POKE53280,BF
  95. 52485 POKE1024,PB:POKE55296,PK:PRINT"";:GET#3,CN$:PE=ASC(CN$)
  96. 52500 IFPK<>PEEK(254)ANDPB<>32THENPOKE254,PK:GOSUB55000
  97. 52510 IFPB<127THENGOSUB56000:GOTO52540
  98. 52520 IFPEEK(828)=0THENPRINT#2,CHR$(18);:SC=SC+1:POKE828,1
  99. 52530 PRINT#2,CHR$(PE);:SC=SC+1
  100. 52540 P=P+1:IFSC-CH<=60ANDP<1001THEN52480
  101. 52545 PRINT#2,CHR$(34);CHR$(59);CHR$(0);:SC=SC+2
  102. 52560 L=L+10:GOSUB51000
  103. 52570 GOTO52410
  104. 52580 :
  105. 52730 REM **************
  106. 52731 REM * TITLE PAGE *
  107. 52732 REM **************
  108. 52733 :
  109. 52734 POKE53280,11:POKE53281,12
  110. 52735 GOSUB60000:POKE646,6
  111. 52780 TM=TI
  112. 52790 IFTM+120>TITHEN52790
  113. 52800 RETURN
  114. 52810 :
  115. 53060 :
  116. 55000 REM ***************
  117. 55001 REM * COLOR CODES *
  118. 55002 REM ***************
  119. 55003 :
  120. 55005 IFPK=0THENPRINT#2,CHR$(144);
  121. 55010 IFPK=1THENPRINT#2,CHR$(5);
  122. 55020 IFPK=2THENPRINT#2,CHR$(28);
  123. 55030 IFPK=3THENPRINT#2,CHR$(159);
  124. 55040 IFPK=4THENPRINT#2,CHR$(156);
  125. 55050 IFPK=5THENPRINT#2,CHR$(30);
  126. 55060 IFPK=6THENPRINT#2,CHR$(31);
  127. 55070 IFPK=7THENPRINT#2,CHR$(158);
  128. 55080 IFPK=8THENPRINT#2,CHR$(129);
  129. 55090 IFPK=9THENPRINT#2,CHR$(149);
  130. 55100 IFPK=10THENPRINT#2,CHR$(150);
  131. 55110 IFPK=11THENPRINT#2,CHR$(151);
  132. 55120 IFPK=12THENPRINT#2,CHR$(152);
  133. 55130 IFPK=13THENPRINT#2,CHR$(153);
  134. 55140 IFPK=14THENPRINT#2,CHR$(154);
  135. 55150 IFPK=15THENPRINT#2,CHR$(155);
  136. 55160 SC=SC+1:RETURN
  137. 55170 :
  138. 56000 REM ******************
  139. 56001 REM * CHECK RVS FLAG *
  140. 56002 REM ******************
  141. 56003 :
  142. 56005 IFPEEK(828)=1THENPRINT#2,CHR$(146);:POKE828,0:SC=SC+1
  143. 56010 PRINT#2,CHR$(PE);:SC=SC+1:RETURN
  144. 56020 :
  145. 57000 REM ///////////////
  146. 57010 REM / SAVE SCREEN /
  147. 57020 REM ///////////////
  148. 57030 :
  149. 57040 GOSUB58000:OPEN2,8,2,"@0:"+FI$+",S,W"
  150. 57045 PRINT"[147]SAVING SCREEN"
  151. 57046 BF=0
  152. 57047 PRINT#2,CHR$(PEEK(253));
  153. 57050 FORI=1TO1000:PRINT#2,CHR$(SC%(I));:PRINT#2,CHR$(CL%(I));
  154. 57052 BF=(BF+1)AND15:POKE53280,BF
  155. 57055 POKE1024,SC%(I):POKE55296,CL%(I):NEXTI
  156. 57056 POKE53280,11
  157. 57060 CLOSE2:RETURN
  158. 57070 :
  159. 57100 REM ///////////////
  160. 57110 REM / LOAD SCREEN /
  161. 57120 REM ///////////////
  162. 57130 :
  163. 57140 GOSUB58000:OPEN2,8,2,"0:"+FI$+",S,R"
  164. 57142 CO=54272
  165. 57145 GET#2,A$:IFA$=""THENA$=CHR$(0)
  166. 57146 PRINT"[147]";:POKE53281,ASC(A$):PS=PEEK(53281)+1
  167. 57147 REM BF=0
  168. 57150 FORI=1024TO2023:GET#2,A$:IFA$=""THENA$=CHR$(0)
  169. 57152 REM BF=(BF+1)AND15:POKE53280,BF
  170. 57155 POKEI,100:POKEI+CO,PS
  171. 57160 POKEI,ASC(A$)
  172. 57165 GET#2,A$:IFA$=""THENA$=CHR$(0)
  173. 57166 POKEI+CO,ASC(A$):NEXTI
  174. 57190 CLOSE2:GOSUB52140:GOSUB52200:POKE53280,11:RETURN
  175. 57195 :
  176. 57200 REM / GET LOOP /
  177. 57210 GETA$:IFA$=""THEN57210
  178. 57215 A=VAL(A$):IFA<1ORA>ZTHEN57210
  179. 57220 RETURN
  180. 57230 :
  181. 57300 REM / CONSTRUCT SCREEN TRUNK /
  182. 57310 GOSUB52000:GOSUB52100:GOSUB52200:RETURN
  183. 57320 :
  184. 57400 REM / CONVERT TO BASIC PROGRAM /
  185. 57410 GOSUB 52300:GOSUB52400:POKE53280,11:POKE646,6:RETURN
  186. 57420 :
  187. 58000 REM / NAME PROMPT /
  188. 58010 PRINT"[147]ENTER THE FILE NAME (DON'T ADD [171])":INPUTFI$:FI$=CHR$(171)+FI$
  189. 58020 RETURN
  190. 58030 :
  191. 59000 REM ////////
  192. 59010 REM / MENU /
  193. 59020 REM ////////
  194. 59030 :
  195. 59045 Z=2:PRINT"[147]"SPC(11)"1[146] - LOAD SCREEN"
  196. 59050 PRINTSPC(11)"2[146] - CONSTRUCT SCREEN"
  197. 59060 GOSUB57200:ON A GOSUB 57100,57300
  198. 59080 RETURN
  199. 59090 :
  200. 59100 Z=3:PRINT"[147]"SPC(11)"1[146] - SAVE SCREEN"
  201. 59110 PRINTSPC(11)"2[146] - CONVERT TO BASIC"
  202. 59115 PRINTSPC(11)"3[146] - RETURN TO MAIN MENU"
  203. 59120 GOSUB 57200:ON A GOSUB 57000,57400
  204. 59130 RETURN
  205. 59200 REM /////////////////////
  206. 59210 REM / SHIFT SCREEN DOWN /
  207. 59220 REM /////////////////////
  208. 59230 :
  209. 59240 PRINT""SPC(10)"LOWERING SCREEN";
  210. 59242 WAIT207,1,1:POKE204,1
  211. 59245 FORI=2023TO1064STEP-1
  212. 59250 POKEI,PEEK(I-40):POKEI+54272,PEEK(I+54272-40)
  213. 59260 NEXTI
  214. 59270 FORI=1024TO1063:POKEI,32:NEXTI
  215. 59275 POKE204,0:POKE205,20
  216. 59280 RETURN
  217. 59290 :
  218. 59300 REM /////////////////////
  219. 59310 REM / SHIFT SCREEN UP   /
  220. 59320 REM /////////////////////
  221. 59330 :
  222. 59340 PRINT""SPC(10)"RAISING SCREEN";
  223. 59342 WAIT207,1,1:POKE204,1
  224. 59345 FORI=1024TO1983
  225. 59350 POKEI,PEEK(I+40):POKEI+54272,PEEK(I+54272+40)
  226. 59360 NEXTI
  227. 59370 FORI=1984TO2023:POKEI,32:NEXTI
  228. 59375 POKE204,0:POKE205,20
  229. 59380 RETURN
  230. 60000 PRINT"[147]                                                             ";
  231. 60010 PRINT"                                                             ";
  232. 60020 PRINT"                                                [151][169]          ";
  233. 60030 PRINT"[151]          [206][146]                 [169]                    [206] [146]     ";
  234. 60040 PRINT"           [151][169]                    [206]  [146]                [144]     ";
  235. 60050 PRINT"[144]                [151]   [146]                [144]                   ";
  236. 60060 PRINT" [144] [151]   [146]                [144]                    [144] [151]   [146]     ";
  237. 60070 PRINT"           [144]   SCREEN  MASTER   [144] [151]   [146]                [144]  ";
  238. 60080 PRINT" [184][184][184][184][184][184][184][184][184][184][184][184][184][184]   [144] [151]   [146]                [144]               ";
  239. 60090 PRINT"     [144] [151]   [146]                [144]         BY         [144] [151]   [146] ";
  240. 60100 PRINT"               [144]                    [144] [151]   [146]                ";
  241. 60110 PRINT"[144]   HOWARD CAMPBELL  [144] [151]   [146]                [144]            ";
  242. 60120 PRINT"        [144] [151]   [146]                [144]                    [144] [151]  ";
  243. 60130 PRINT"[151] [146]                [144]                     [151]  [146][169]             ";
  244. 60140 PRINT"   [144]             [209][209]...   [151] [146][169]                 [144]            ";
  245. 60150 PRINT"[144]         [151][146][169]                                               ";
  246. 60160 PRINT"                                                             ";
  247. 60170 PRINT"                                                             ";
  248. 60180 RETURN
  249.